package com.gxufl.service;

import java.util.List;

import com.gxufl.dao.NoticeDao;
import com.gxufl.entity.Notice;

public class NoticeService {
	NoticeDao dao=new NoticeDao();
	public List<Notice> searchNotice(){
		//List<Notice> list=null;
		//从dao层获取list海报数据
		
		List<Notice> list= dao.findList(null,null);
		return list;
	}
	
	public List<Notice> searchNotice(String name,String showdate){
		return dao.findList(name, showdate);
	}
	
	public void saveNotice(Notice notice) {
		// TODO Auto-generated method stub		
		dao.save(notice);
	}

	public void deleteNotice(String name) {
		// TODO Auto-generated method stub
		dao.delete2(name);
	}
	
	public Notice searchOneNotice(String noticename) {
		List<Notice> list = this.searchNotice(noticename, null);
		if(list.size() == 1) {
			return list.get(0);
		} else {
			System.out.println("错误，找到了"+list.size()+"个不同的电影");
		}
		return null;
	}
	
}
